package xxm.service;

import xxm.exception.ServiceException;

/**
 * log manager interface 
 * @author Administrator
 *
 */
public interface BasicLogManager {

	/**
	 * open log
	 * @param strFileName
	 * @return 
	 * @throws ServiceException
	 */
	public boolean openLog(final String strFileName ) throws ServiceException;
	
	/**
	 * check log is open
	 * @return
	 * @throws ServiceException
	 */
	public boolean isOpen() throws ServiceException;
	
	/**
	 * close log 
	 * @return
	 * @throws ServiceException
	 */
	public boolean closeLog() throws ServiceException;
	
	/**
	 * write log data
	 * @param strBuf
	 * @return
	 * @throws ServiceException
	 */
	public int writeLog( final String strBuf )throws ServiceException;
	
	/**
	 * write log data
	 * @param format
	 * @param args
	 * @return
	 * @throws ServiceException
	 */
	public int writeLog( final String format, Object ... args )throws ServiceException;
	
	/**
	 * output file
	 * @param logLevel
	 * @param file : log file
	 * @param line : source line
	 * @param format 
	 * @param args
	 * @throws ServiceException
	 */
	public void outFile(int logLevel, final String file, int line, final String format, Object ... args) throws ServiceException;
	
	/**
	 * get file len
	 * @param fullName
	 * @return
	 * @throws ServiceException
	 */
	public int getFileLen(final String fullName) throws ServiceException;
	
	/**
	 * check level log 
	 * @param loglevel
	 * @return
	 * @throws ServiceException
	 */
	public boolean isEnableLog(int loglevel)throws ServiceException;
	
	
}
